package system.main;

import org.apache.commons.dbcp.BasicDataSource;

import com.hong.alert.dao.ReferenceDataRepossitory;

import models.EventsType;
import models.GenerationRate;
import models.SubscribeEvents;
import system.eventBuffer.EventBuffer;
import system.queues.AlertQueue;
import system.queues.LogQueue;
import system.queues.WarningQueue;

public class SystemDataStructure {
	private EventBuffer eBuffer;
	private EventsType eType;
	private SubscribeEvents subscribeEvents;
	private GenerationRate rate;
	private AlertQueue alertQueue;
	private WarningQueue warningQueue;
	private LogQueue logQueue;
	private ReferenceDataRepossitory referenceDataRepossitory;

	public SystemDataStructure() {
		eBuffer = new EventBuffer();
		eType = new EventsType();
		rate = new GenerationRate();
		subscribeEvents = new SubscribeEvents();
		alertQueue = new AlertQueue();
		warningQueue = new WarningQueue();
		setLogQueue(new LogQueue());
		referenceDataRepossitory = new ReferenceDataRepossitory();
		BasicDataSource dataSource = new BasicDataSource();
		dataSource.setDriverClassName("com.mysql.jdbc.Driver");
		String url = "jdbc:mysql://localhost:3306/alertsystem";
		dataSource.setUrl(url);
		dataSource.setUsername("root");
		referenceDataRepossitory.setDataSource(dataSource);
	}

	public WarningQueue getWarningQueue() {
		return warningQueue;
	}

	public void setWarningQueue(WarningQueue warningQueue) {
		this.warningQueue = warningQueue;
	}

	public AlertQueue getAlertQueue() {
		return alertQueue;
	}

	public void setAlertQueue(AlertQueue alertQueue) {
		this.alertQueue = alertQueue;
	}

	public EventBuffer getEventBuffer() {
		return eBuffer;
	}

	public EventsType getEventType() {
		return eType;
	}

	public GenerationRate getRate() {
		return rate;
	}

	public void setGenerationRate(GenerationRate rate) {
		this.rate = rate;
	}

	public SubscribeEvents getSubscribeEvents() {
		return subscribeEvents;
	}

	public void setSubscribeEvents(SubscribeEvents subscribeEvents) {
		this.subscribeEvents = subscribeEvents;
	}

	public ReferenceDataRepossitory getReferenceDataRepossitory() {
		return referenceDataRepossitory;
	}

	public void setReferenceDataRepossitory(
			ReferenceDataRepossitory referenceDataRepossitory) {
		this.referenceDataRepossitory = referenceDataRepossitory;
	}

	public LogQueue getLogQueue() {
		return logQueue;
	}

	public void setLogQueue(LogQueue logQueue) {
		this.logQueue = logQueue;
	}

}
